const mongoose = require('./index');

const ShiSchema = new mongoose.Schema({
  title: { type: String, required: true },
  cover: { type: String, required: false },
  videourl: { type: String, required: true },
  fileName: { type: String, required: true },
  fileSize: { type: Number, required: true },
  fileType: { type: String, required: true },
  uploadDate: { type: Date, default: Date.now },
  views: { type: Number, default: 0 },
  likes: { type: Number, default: 0 },
  publishDate: { type: Date, default: Date.now },
  description: String,
  relatedVideos: [{ type: mongoose.Schema.Types.ObjectId, ref: 'Shi' }] // 添加相关视频字段
}, { collection: 'shi' });

module.exports = mongoose.model('Shi', ShiSchema);
